﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>会员卡管理表</title>
<script type="text/javascript" src="../js/common.js"></script>
<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery.pager.js"></script>
<script type="text/javascript" src="../js/gbRst.js"></script>
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="../js/shop.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script>
<script type="text/javascript" src="../js/shopSelecterNew.js"></script>
<script type="text/javascript" src="../js/find.js"></script>
<script type="text/javascript" src="../js/pagination.js"></script>
<script type="text/javascript" src="../js/doubleDate2.0.js"></script> 
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<style type="text/css">
.moreData{width:100%;overflow-x:scroll;}
.member_list th{white-space:nowrap;}
</style>
<script type="text/javascript">
$(function(){
	$("#shopIsChoosed").click(function(){
		if($("#shopIsChoosed").is(":checked")){
			$("#shopName").attr("disabled",false);
			
		}else{
			$("#shopName").attr("disabled",true);
		}
	});
	$('#dtBegin').val(getToday());
	 $('#dtEnd').val(getToday());
	 refreshInput($(".serWrapper"));
		$('.doubledate').kuiDate({
			className:'doubledate',
			isDisabled: "0"  // isDisabled为可选参数，“0”表示今日之前不可选，“1”标志今日之前可选
		});
})

var pageIndex = 1
function search(index){
	if(IsNotEmpty(index)){
	pageIndex = index	
	}else{
		pageIndex = 1;
	}
	var mp=$("#mp").val().replace(/\s/gi,'');	
	var cardNo=$("#cardNo").val().replace(/\s/gi,'');
	var custName=$("#custName").val();
	var shopId="";
	if($("#shopIsChoosed").is(":checked")){		
		shopId=$("#shopName").val();
		if(IsEmpty(shopId)){
			shopId = "";
		}
	}
	
	var params = {'mp':mp,'card':cardNo,'custName':custName,'shopId':shopId}
	
	var dt = _findInfo("../memberExclusiveService/find/memberOwnServiceRecord/"+(pageIndex-1)+"/10", params)
	if(IsNotEmpty(dt)&&dt.state==0){
/* 		var p = new Array(cl","ls","FactAmt","FreeAmt","BankAmt","CashAmt","CashCouponAmt","DepositAmt","DepositAmt","VoucherAmt","VoucherMemo","VoucherAmt2","VoucherMemo2","FreeAmt");
		_loadInfo(dt, "memberList", p); */
		$("#memberList tbody").empty()
		$("#sup").html("共"+dt.result.len+"条")
		for(var i=0;i<dt.result.data.length;i++){
			var status = _getIntOfJson(i, dt, "status");
			if(status ==4){
				
			var htm="<tr style=\"white-space: nowrap;color:red;\">"
			}else{
				
			var htm="<tr style=\"white-space: nowrap;\">"
			}

				htm+="<td>"+_getSomeOfJson(i, dt, "CustomerName")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "Mp")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "LevelName")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "MemberCardNo")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "License")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "VIN")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "pmuseNums")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "xbuserNums")+"</td>"
				htm+="<td>"+(_getIntOfJson(i, dt, "xbnum") -_getIntOfJson(i, dt, "xbuserNums") ) +"</td>"
				var hy = _getStringOfJson(i, dt, "hyuserNums");
				var ybhyuseNums = _getStringOfJson(i, dt, "ybhyuseNums");
				var n = null;
				if(hy>0){
					n="换油"
						htm+="<td>"+n+"</td>"
						htm+="<td>"+_getIntOfJson(i, dt, "hyuserNums")+"</td>"
						htm+="<td>"+(_getIntOfJson(i, dt, "hynums") -_getIntOfJson(i, dt, "hyuserNums") )+"</td>"

				}else if(ybhyuseNums>0){
					n="延保"
						htm+="<td>"+n+"</td>"

						htm+="<td>"+_getIntOfJson(i, dt, "ybhyuseNums")+"</td>"
						htm+="<td>"+(_getIntOfJson(i, dt, "ybhynums") -_getIntOfJson(i, dt, "ybhyuseNums") )+"</td>"

				}else{
					n="未选择"
						htm+="<td>"+n+"</td>"
						htm+="<td>"+n+"</td>"
						htm+="<td>"+n+"</td>"
				}
				htm+="<td>"+_getIntOfJson(i, dt, "qcmquseNums")+"</td>"
				htm+="<td>"+(_getIntOfJson(i, dt, "qcmqnums") -_getIntOfJson(i, dt, "qcmquseNums") )+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "jcjsuseNums")+"</td>"
				htm+="<td>"+(_getIntOfJson(i, dt, "jcjsnums") -_getIntOfJson(i, dt, "jcjsuseNums") )+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "dbnsuseNums")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "yzsfwuseNums")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "hyhduseNums")+"</td>"

				htm+="</tr>"
				$("#memberList tbody").append(htm)
		}
		
		_loadPage("pager", pageIndex, 10, dt, search, "NoResult")
	}
	/* var dt2 = _findInfo("../saleBill/find/allRecordSum", params)
	if(IsNotEmpty(dt2)&&dt2.state==0){
		var factAmt = _getIntOfJson(0, dt2, "factamt");
		var FreeAmt = _getIntOfJson(0, dt2, "FreeAmt");
		var CashAmt = _getIntOfJson(0, dt2, "CashAmt");
		var BankAmt = _getIntOfJson(0, dt2, "BankAmt");
		var CashCouponAmt = _getIntOfJson(0, dt2, "CashCouponAmt");
		var DepositAmt = _getIntOfJson(0, dt2, "DepositAmt");
		var VoucherAmt = _getIntOfJson(0, dt2, "VoucherAmt");
		var VoucherAmt2 = _getIntOfJson(0, dt2, "VoucherAmt2");
		var IntegralAmt = _getIntOfJson(0, dt2, "IntegralAmt");
		var gs = _getIntOfJson(0, dt2, "gs");
		var cl = _getIntOfJson(0, dt2, "cl");
		var ls = _getIntOfJson(0, dt2, "ls");
		var htm="实收总计："+factAmt+"&nbsp;"+"其中："+"储值支付："+DepositAmt+"&nbsp;预收支付："+CashCouponAmt+"&nbsp;积分抵现："+IntegralAmt+"&nbsp;信用卡支付："+BankAmt+"&nbsp;现金支付："+CashAmt+"&nbsp;工时抵减："+VoucherAmt+"&nbsp;备件抵减："+VoucherAmt2
		$("#sum").html(htm)
	}
 */
	
}

function toAdd(){
	var mp=$("#mp").val().replace(/\s/gi,'');	
	var cardNo=$("#cardNo").val().replace(/\s/gi,'');
	var custName=$("#custName").val();
	var shopId="";
	if($("#shopIsChoosed").is(":checked")){		
		shopId=$("#shopName").val();
		if(IsEmpty(shopId)){
			shopId = "";
		}
	}
	
	var params = {'mp':mp,'card':cardNo,'custName':custName,'shopId':shopId,'downType':23}
	window.location.href="../csvdown/down/csv/down?"+$.param(params)
}
</script>
</head>

<body>
<div class="container" id="container">
  <div class="container_R fr">
	<div class="place">会员卡管理表</div>
	<div class="member_search">
      <p><span>
        <input type="checkbox" id="shopIsChoosed" style="width:auto;height:auto;border:none;">
        店面：</span>
        <select disabled="disabled" id="shopName" onclick="openShopListPanel(this)" style=";height:20px;">
        </select>
       
      
      <span>姓名：</span>
        <input type="text" id="custName" class="absoluteTxt">
      <span>手机号：</span>
      <input type="text" id="mp" class="absoluteTxt">
      </p>
      <p>
        <span>会员卡号：</span>
        <input type="text" id="cardNo" class="absoluteTxt">
    
      
            <input type="button" style="float: right;" value="查询" class="btn" onclick="search(1)">
      
      </p>
    </div>
	
    <div class="moreData">
    <table class="member_list" cellpadding="0" cellspacing="1" border="0" id="memberList" style="margin-top:45px;position:relative;">
    	<caption class="fixedTit"><strong>列表        <span id="sup">共0条</span></strong><input type="button" value="导出" class="common_btn addList" onclick="toAdd()"></caption>
    	<thead>
    	<tr style="white-space: nowrap;">
        	<th>客户姓名</th>
        	<th>电话</th>
        	<th>会员级别</th>
        	<th>会员卡号</th>
        	<th>车牌号</th>
        	<th>车架号</th>
        	<th>PM2.5净化装置</th>
        	<th>续保使用次数</th>
        	<th>续保余额</th>
        	<th>延保或换油五次</th>
        	<th>使用次数</th>
        	<th>余额</th>
        	<th>汽车美容项目使用</th>
        	<th>汽车美容项目余额</th>
        	<th>机场接送使用</th>
        	<th>机场接送余额</th>
        	<th>代表年审</th>
        	<th>一站式服务</th>
        	<th>普通会员活动</th>
        </tr>
        </thead>
        <tbody></tbody>
    </table>
    </div>
     <div id="sum" style="float: left;"></div>
    <div id="NoResult"  class="Nothing" style="text-align:center;display: none;">无符合条件的数据！</div>
    <div id="pager" style="float: right;"></div>
  </div>
  <div class="fc"></div>
</div>
<script type="text/javascript" src="../js/header.js"></script> 
<script type="text/javascript" src="../js/left.js"></script> 
<script type="text/javascript" src="../js/footer.js"></script> 
<script type="text/javascript">
$(".moreData").scroll(function(){
	if($(this).scrollLeft()+$(this).width()>=$(this).find("table").width())return;
	$(this).find(".fixedTit").css("left",$(this).scrollLeft())	
})
addMargin($(".hideDiv"))
clearThis("absoluteTxt");
</script>
</body>
</html>
"WebContent/html/temp.html"